
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

        
		<meta http-equiv="Expires" content="-1">		    	        	            
		<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
		<meta http-equiv="Cache-Control" content="no-store">
		<meta http-equiv="Cache-Control" content="must-revalidate">	  	  	    
        <meta http-equiv="cache-control" content="max-age=0" />		        
		<meta http-equiv="Pragma" content="no-cache">        
    </head>
    <body>
    
<?php


// FALTARÍA CONTROLARLO PARA ENTORNO LOCAL, DONDE $_SERVER['DOCUMENT_ROOT'] ES NULO. ¿INVOCAR A FUNCIÓN POR SU URL RELATIVA?
echo "PATH_SEPARATOR" . PATH_SEPARATOR;
echo "<br>";
define("CLASS_ENVIRONMENT_CONFIG",  $_SERVER['DOCUMENT_ROOT'] . "/webmuebles/public/php/wm/class/config/EnvironmentConfig.php");
echo "CLASS_ENVIRONMENT_CONFIG: " . CLASS_ENVIRONMENT_CONFIG;
echo "<br>";
require_once (CLASS_ENVIRONMENT_CONFIG);
echo "EnvironmentConfig.PATH_DOC_ROOT_FOLDER: ". EnvironmentConfig::$PATH_DOC_ROOT_FOLDER;
echo "<br>";
echo "<br>";


/** ------------------------------------------------------------------------------------------ */
/** ABRIR CONEXIÓN DB MYSQL */
/** ------------------------------------------------------------------------------------------ */
// Create connection
$con=mysqli_connect(EnvironmentConfig::$DB_HOST, EnvironmentConfig::$DB_USER, EnvironmentConfig::$DB_PASS, EnvironmentConfig::$DB_NAME, EnvironmentConfig::$DB_PORT);

// Check connection
if (mysqli_connect_errno($con))
{
	echo "Falló la conexón a: " . mysqli_connect_error();
}
else {
	echo "Conexión correcta<br>";
}


echo "ACTUAL CHARSET: " . $con->character_set_name();
echo "<br>";

/** ------------------------------------------------------------------------------------------ */
/** CAMBIAR ENCODING CONEXIÓN DB MYSQL */
/** ------------------------------------------------------------------------------------------ */
/* change character set to utf8 */
if (!$con->set_charset("utf8")) {
	printf("Error loading character set utf8: %s\n", $con->error);
} else {
	printf("<br>CAMBIADO ENCODING CONEXIÓN DB A: %s\n", $con->character_set_name());
}

echo "<br>";
echo "<br>";


/** ------------------------------------------------------------------------------------------ */
/** SELECT DB */
/** ------------------------------------------------------------------------------------------ */
// Recuperar datos DB
$result = mysqli_query($con,"SELECT * FROM WM_C_DIR_PROVINCIA");
echo "Test SELECT:";
echo "<br>";
while($row = mysqli_fetch_array($result))
{
	echo $row['ID_PAIS'] . " - " . $row['CD_PROVINCIA']. " - " . $row['DS_NOMBRE'];
	echo "<img src='/webmuebles/public/img/portal/ball_green_small.png'>";
	echo "<br>";
}

/** ------------------------------------------------------------------------------------------ */
/** CERRAR CONEXIÓN DB MYSQL */
/** ------------------------------------------------------------------------------------------ */
// Cerrar conexión
mysqli_close($con);


echo "<br>FÍN<BR><BR>";

echo "Current date : ";
echo date("l F d, Y - h:i:s");
echo "<br>";
echo date(DateTime::ISO8601);
echo "<br><br>";
echo gmdate(DateTime::ISO8601);
echo "<br><br>";
$tz = new DateTimeZone("Europe/Prague");
print_r($tz->getLocation());
print_r(timezone_location_get($tz));
//phpinfo();
?>

    </body>
</html>